Drucken

Linux

SuSE

LINUX SuSE

Redhat

LINUX Redhat?

Ubuntu

LINUX Ubuntu

usefull Konfigurations

Master Boot Record

Der Master Boot Record (kurz MBR) bzw. Partitionssektor ist bei BIOS-basierten Computern der x86-Architektur der erste Datenblock (512 Byte) eines in Partitionen aufgeteilten Speichermediums, wie beispielsweise einer Festplatte. Der MBR enthält eine Partitionstabelle, die die Aufteilung des Datenträgers beschreibt, und optional einen Boot-Loader, ein Programm, das ein Betriebssystem auf einer der Partitionen startet.

siehe Wikipedia Artikel:
http://de.wikipedia.org/wiki/Master_Boot_Record#GRUB(external link)

raid configuration

raid on disks greater 2TB

setting up raid with gpt for disks greater 2TB
parted is a replacement for fdisk of Linux. It can handle disks larger than 2 TB. Issue this command to launch parted where /dev/sdX is the disk you want to initialize.
parted /dev/sdX

create a new gpt disklabel (partition table)
mktable gpt
To create a new partition, mkpart is used to do so. This parted command creates a primary ext4 partition, starting at the first cylinder to the last sector of the disk.
mkpart primary 1 -1
set raid Label on new defined partition, print result and quit.
set 1 raid on
print
quit

or
parted /dev/sdX "mktable gpt"
parted /dev/sdX "mkpart primary 1 -1"
parted /dev/sdX "set 1 raid on"
parted /dev/sdX "print"

Deleting a Linux Software Raid Array

In this case partitions on 2 SATA drives had been accidentally forced into a md0 RAID1 array.
Stop the array:
mdadm --stop /dev/md0

Delete the array:
mdadm --remove /dev/md0

Zero the superblocks:
mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdc1

re-create /etc/mdadm/mdadm.conf
save your current configuration
mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_`date +%y%m%d`

and create new file
echo "#New RAID SCAN" > /etc/mdadm/mdadm.conf
mdadm --examine --scan >> /etc/mdadm/mdadm.conf

Linux video mode numbers

The Linux kernel allows user configuration of VESA modes at boot time using the vga kernel parameter. This parameter does not directly accept VESA video mode numbers; instead, a Linux video mode number must be calculated using the VESA number.
To calculate the Linux video mode number add 512. The resulting decimal value can be passed to the kernel in the form 'vga=XXX', where XXX is the decimal value, or in form 'vga=0xHHH', where HHH is the hexadecimal value. This calculation is not always accurate. It is a good starting point and you may have to do some experimenting to find the correct value.
> Farbtiefe 320x200 640x400 640x480 800x500 800x600 896x672 1024x640 1024x768 1152x720 1280x1024 1400x1050 1440x900 1600x1200 1920x1200
16colors 770 772 774
256collors 768 769 879 771 815 874 773 869 775 835 864 796 893
15-bit(5:5:5) 781 801 784 880 787 816 875 790 870 793 865 797
16-bit(5:6:5) 782 802 785 881 788 817 876 791 871 794 837 866 798
24-bit(8:8:8) 783 803 786 882 789 818 877 792 872 795 838 867 799
32-bit(8:8:8) 804 809 883 814 819 878 824 873 829 868 834

usefull commands

sudo

sudo Konfiguration

Beispiel für eine sudo Konfiguration
#
# Sample /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

##
# User alias specification
##
User_Alias	FULLTIMERS = millert, mikef, dowdy
User_Alias	PARTTIMERS = bostley, jwfox, crawl
User_Alias	WEBMASTERS = will, wendy, wim

##
# Runas alias specification
##
Runas_Alias	OP = root, operator
Runas_Alias	DB = oracle, sybase

##
# Host alias specification
##
Host_Alias	SPARC = bigtime, eclipse, moet, anchor:\
		SGI = grolsch, dandelion, black:\
		ALPHA = widget, thalamus, foobar:\
		HPPA = boa, nag, python
Host_Alias	CUNETS = 128.138.0.0/255.255.0.0
Host_Alias	CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0
Host_Alias	SERVERS = master, mail, www, ns
Host_Alias	CDROM = orion, perseus, hercules

##
# Cmnd alias specification
##
Cmnd_Alias	DUMPS = /usr/sbin/dump, /usr/sbin/rdump, /usr/sbin/restore, \
			/usr/sbin/rrestore, /usr/bin/mt
Cmnd_Alias	KILL = /usr/bin/kill
Cmnd_Alias	PRINTING = /usr/sbin/lpc, /usr/bin/lprm
Cmnd_Alias	SHUTDOWN = /usr/sbin/shutdown
Cmnd_Alias	HALT = /usr/sbin/halt, /usr/sbin/fasthalt
Cmnd_Alias	REBOOT = /usr/sbin/reboot, /usr/sbin/fastboot
Cmnd_Alias	SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
			 /usr/local/bin/tcsh, /usr/bin/rsh, \
			 /usr/local/bin/zsh
Cmnd_Alias	SU = /usr/bin/su
Cmnd_Alias	VIPW = /usr/sbin/vipw, /usr/bin/passwd, /usr/bin/chsh, \
		       /usr/bin/chfn

##
# Override built-in defaults
##
Defaults               syslog=auth
Defaults:FULLTIMERS    !lecture
Defaults:millert       !authenticate
Defaults@SERVERS       log_year, logfile=/var/log/sudo.log

##
# User specification
##

# root and users in group wheel can run anything on any machine as any user
root		ALL = (ALL) ALL
%wheel		ALL = (ALL) ALL

# full time sysadmins can run anything on any machine without a password
FULLTIMERS	ALL = NOPASSWD: ALL

# part time sysadmins may run anything but need a password
PARTTIMERS	ALL = ALL

# jack may run anything on machines in CSNETS
jack		CSNETS = ALL

# lisa may run any command on any host in CUNETS (a class B network)
lisa		CUNETS = ALL

# operator may run maintenance commands and anything in /usr/oper/bin/
operator	ALL = DUMPS, KILL, PRINTING, SHUTDOWN, HALT, REBOOT,\
		/usr/oper/bin/

# joe may su only to operator
joe		ALL = /usr/bin/su operator

# pete may change passwords for anyone but root on the hp snakes
pete		HPPA = /usr/bin/passwd [A-z]*, !/usr/bin/passwd root

# bob may run anything on the sparc and sgi machines as any user
# listed in the Runas_Alias "OP" (ie: root and operator)
bob		SPARC = (OP) ALL : SGI = (OP) ALL

# jim may run anything on machines in the biglab netgroup
jim		+biglab = ALL

# users in the secretaries netgroup need to help manage the printers
# as well as add and remove users
+secretaries	ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser

# fred can run commands as oracle or sybase without a password
fred		ALL = (DB) NOPASSWD: ALL

# on the alphas, john may su to anyone but root and flags are not allowed
john		ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*

# jen can run anything on all machines except the ones
# in the "SERVERS" Host_Alias
jen		ALL, !SERVERS = ALL

# jill can run any commands in the directory /usr/bin/, except for
# those in the SU and SHELLS aliases.
jill		SERVERS = /usr/bin/, !SU, !SHELLS

# steve can run any command in the directory /usr/local/op_commands/
# as user operator.
steve		CSNETS = (operator) /usr/local/op_commands/

# matt needs to be able to kill things on his workstation when
# they get hung.
matt		valkyrie = KILL

# users in the WEBMASTERS User_Alias (will, wendy, and wim)
# may run any command as user www (which owns the web pages)
# or simply su to www.
WEBMASTERS	www = (www) ALL, (root) /usr/bin/su www

# anyone can mount/unmount a cd-rom on the machines in the CDROM alias
ALL		CDROM = NOPASSWD: /sbin/umount /CDROM,\
		/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM